<div class="random_thumbs">
</div>
<body>
<?php echo(get_analytics_code()) ?>
	<script>
	  window.fbAsyncInit = function() {
		// init the FB JS SDK
		FB.init({
		  appId      : '<?php echo FB_APP_ID ?>',                        // App ID from the app dashboard
		  channelUrl : '//toptattoos.net/channel.php', // Channel file for x-domain comms
		  status     : true,                                 // Check Facebook Login status
		  xfbml      : true                                  // Look for social plugins on the page
		});

		// Additional initialization code such as adding Event Listeners goes here
		
	  };

	  // Load the SDK asynchronously
	  (function(d, s, id){
		 var js, fjs = d.getElementsByTagName(s)[0];
		 if (d.getElementById(id)) {return;}
		 js = d.createElement(s); js.id = id;
		 js.src = "//connect.facebook.net/en_US/all.js";
		 fjs.parentNode.insertBefore(js, fjs);
	   }(document, 'script', 'facebook-jssdk'));

	  
	</script>

	<script type="text/javascript">var switchTo5x=true;</script>
	<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
	<script type="text/javascript">stLight.options({publisher: "72d0e931-330a-4a87-96b1-4491c82db79a", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
	<div id="fb-root"></div>
	<div id="tmp-img" style="display:none"></div>

<div id="head-wrapper">
	<div id="head-bar">
		 <h1>
		<?php if(logo_format())
		{ ?>
		<a href="<?php echo(rootpath()) ?>/"><img src="<?php echo(rootpath() . "/images/" . get_logo()) ?>"/></a>
		<?php } else { ?>
		   <a href="<?php echo(rootpath()) ?>/"><?php echo(get_logo_text()) ?></a>
			<?php } ?> 
			</h1>
			
			
			<ul class="main-menu" style="overflow:visible"> 
				<?php if((allow_pictures()) || (allow_videos()) || (allow_gifs())) { ?>	
					<li><a class="" href="<?php echo(rootpath()) ?>/">Tất cả</a></li>
					
				<?php } if(allow_pictures()) { ?>				
					<li><a class="" href="<?php echo(rootpath()) ?>/pictures">Ảnh vui</a></li>	
				
				<?php } if(allow_gifs()) { ?>	
					<li><a class="" href="<?php echo(rootpath()) ?>/hai-nao">Hại não</a></li>
				
				<?php } if(allow_videos()) { ?>	
					<li><a class="" href="<?php echo(rootpath()) ?>/videos">Clip</a></li>
				<?php }?>	
				<?php if((allow_pictures()) || (allow_videos()) || (allow_gifs())) { ?>	
					<li><a class="random-button" href="<?php echo(rootpath())?>/random.php" id="rand-but"><strong>Shuffle</strong></a></li> 
				<?php } ?>	 
				<li>
				<?php
				if(isset($_SESSION['user']['name'])){
					echo '<div class="menu-item">Chào bạn ' . $_SESSION['user']['name'] . '</div><div id="logout"><img src="' . rootpath() . '/images/logout.png" title="Thoát" style="margin-top: 12px;" /></div><iframe name="myIFrame" id="myIFrame" style="display:none"></iframe>';
				}
				else{
				?>
				<div class="menu-item">Đăng nhập bằng </div>
				<div id="fblogin"><img src="<?php echo rootpath() ?>/images/facebook-icon.png" style="margin-left: 5px; margin-top: 7px;" /></div>
				<div onClick="login();" id="gpluslogin"><img src="<?php echo rootpath() ?>/images/gplus-icon.png" style="margin-left: 5px; margin-top: 7px;" /></div>
				<?php
				}
				?>
				</li>
			</ul>
			
			
			<ul class="main-2-menu">
				<?php if((allow_pictures()) || (allow_videos()) || (allow_gifs())) { ?>	
					<?php if(rss_enable()){ ?>
						<li><a class="add-rss" href="<?php echo(rootpath()) ?>/rss">RSS</a></li>
					<?php } if(guest_submission_enabled())
					{ ?>
					<li><a class="add-post" href="<?php echo(rootpath()) ?>/submit.php">Gửi bài của bạn</a></li> 	     
					<?php } ?>	
				
					<li><form action="<?php echo(rootpath()) ?>/search.php" method="post">
						<input id="sitebar_search_header" type="text" class="search search_input" name="query" tabindex="1" placeholder="Search"/>
						</form>
					</li>
				<?php } ?>
			</ul>
    </div>
	
        	
</div>
	<link href="<?php echo(rootpath()) ?>/css/nexthon.css" media="screen" rel="stylesheet" type="text/css" />
	<?php
		if(show_nav())
		{
			random_thumbs();
		}
		else
		{
			echo '<div class="nexthon-bar" style="padding: 0px 0px;margin-top: 40px; height:12px;"></div>';
		}
	?>
	<div style="clear:both; margin-top:160px;"></div>

	<div id="container" style="">
		<div class="tiptop fl tipgreen">
		        <p>
		            <b>Mẹo</b>: Cuộn xuống/cuộn lên thoải mái nhờ 2 nút W/S nha.</p>
		        <span class="sprite fl"></span>
		    </div>
		<div id="main">
		<?php if(trim(show_leaderboard1_ad())) { ?>
		<div id="main-bottom-ad-tray">
			<div>
					<div style='width:728px; height:90px; border:1px solid #DFDFDF;' align='center'><?php echo(show_leaderboard1_ad()) ?></div>
			</div>
		</div>
		<?php } ?>